﻿<%@ Page language="c#" Inherits="EPiServer.Labs.MobilePack.Site.MobileSite" Codebehind="MobileSite.aspx.cs" MasterPageFile="~/modules/MobilePack/Mobile.Master" AutoEventWireup="false" %>
<%@ Register TagPrefix="EPiServer" Namespace="EPiServer.WebControls" Assembly="EPiServer" %>
<%@ Register TagPrefix="EPiServer" Namespace="EPiServer.Web.WebControls" Assembly="EPiServer" %>
<%@ Register TagPrefix="EPiServer" Namespace="EPiServer.Web.WebControls" Assembly="EPiServer.Web.WebControls" %>

 <asp:Content runat="server" ContentPlaceHolderID="BodyContents">

 <div data-role="page" class="mobilePage" data-theme='<%= GetSiteData()["PageTheme"] %>'>
    <div data-role="header" data-theme='<%= GetSiteData()["PageTheme"] %>'>
        <h1><%= CurrentPage["Header"] ?? CurrentPage["PageName"] %></h1>
        <% if (!IsMainSitePage)
           { %>
        <a href='<%= GetSiteData().LinkURL %>' data-icon="home" data-iconpos="notext" data-direction="reverse" class="ui-btn-left jqm-home">Home</a> 
        <% } %>
    </div>

    <div data-role="content">
        <EPiServer:Property runat="server" CssClass="bodyContent" PropertyName="MainBody" />
         <form id="Form1" runat="server">
        <EPiServer:Property runat="server" PropertyName="Form" DisplayMissingMessage="false" />
         </form>
    </div>
    <div data-role="footer" data-theme='<%= GetSiteData()["PageTheme"] %>'>
        
        <EPiServer:Property ID="FooterTextProp" runat="server" PropertyName="FooterText" />        
        <div data-role="navbar" >
		<EPiServer:Property ID="FooterNavigationProp" CssClass="bodyContent" runat="server" PropertyName="FooterNavigation" />
	    </div>
        <p style="text-align: center;"><a href="/" class="toggle-desktop-mobile" data-ajax="false">Normal version</a></p>
    </div>

    <script>
        // This event gets called after a page has finished loading (same as $(document).ready() in jQuery).
        // Placed here because if bug in jQuery Mobile and pageinit not always firing
        $(".mobilePage").live('pageinit', MobilePack.pageInit);
    </script>
 </div>
 </asp:Content>
